import { useState, useEffect } from 'react'
import { getDepartments } from '~/api/config'

export default function useGetDepartMents() {
  const [configs, setConfigs] = useState<any>([])
  useEffect(() => {
    getDepartments().then((res: any) => {
      setConfigs(res)
    })
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [])
  return configs
}
